<template>
<q-dialog :dark="isDark" persistent fixed v-model="isOpen" :maximized="$q.platform.is.mobile" position="standard" transition-show="slide-up" transition-hide="slide-down">
    <q-layout view="hHh Lpr fFf" container class=" hide-scrollbar">
        <q-header :class="isDark?'bg-grey-10 shadow-7':''">

            <q-toolbar>
                <q-toolbar-title>{{title}}</q-toolbar-title>
                <q-space />

                <q-btn dense flat icon="close" @click="trigerUpdate('close')">
                </q-btn>
            </q-toolbar>

        </q-header>
        <q-footer :class="isDark?'bg-grey-10 q-pa-sm shadow-up-7':'q-pa-sm shadow-up-7'">
          <slot name="foot"></slot>

            <q-toolbar  class="full-width row justify-between">
              <div class="row justify-end text-subtitle1 text-bold ">
               {{ footInfo }}
              </div>
                <q-space></q-space>
                <q-btn outline class="q-px-md q-mr-sm" @click="cancel"> {{cancelLabel}} </q-btn>
                <q-btn outline class="q-px-md" @click="submit"> {{subitLabel}}</q-btn>
            </q-toolbar>
        </q-footer>
        <q-page-container >
          <q-page :class="isDark?'bg-dark':'bg-blue-grey-1'">
            <slot name="content"></slot>
          </q-page>

        </q-page-container>

    </q-layout>

</q-dialog>
</template>

<script>
import {
    getProjectType
} from "assets/api/project";
import {submitQuote} from "assets/api/app"
export default {
    name: 'MyDialog',

    props: {
        isOpen: {
            default: false
        },
        footInfo:{
          default:null
        },
        title:{
          default:'标题'
        },
        isDark:{
          default:false
        },
        subitLabel:{
          default:'确认'
        },
        cancelLabel:{
          default:'取消'
        }

    },
    data() {
        return {

        }
    },
    watch: {

    },
    methods: {



        trigerUpdate(type) {
            if(type == 'close')
            this.$emit('close')
        },
        handleReset() {
            this.createQuote =  {
                name: "",
                type: {
                    pt_id: 3,
                    typename: '宣传片'
                },
                resolution: {
                    name: "HD(1080P)",
                    val: "HD",
                },
                fps: 25,
                lastTime: {
                    from: "",
                    to: "",
                },
                aspectRatio: "16:9",
                isCommercial:false,

                CJ:0,
                CJ_remark:'',
                SR:0,
                SR_remark:'',
                QD:0,
                QD_remark:'',
                CZ:0,
                CZ_remark:'',
                YD:0,
                YD_remark:'',
                FZ:0,
                FZ_remark:'',
                JJ:0,
                JJ_remark:'',
                TS:0,
                TS_remark:'',
                YS:0,
                YS_remark:'',
                SB:0,
                SB_remark:'',
                DT:0,
                DT_remark:'',
                PY:0,
                PY_remark:'',
                vat:3,
                cg_time:'',
                zg_time:'',
                preTotal:0,
                postTotal:0,
                vatTotal:0,
                costTotal:0,
            }
            this.preTotal=0
            this.postTotal=0
            this.costTotal=0
        },
        submit(){
          this.$emit('submit')
        },
        cancel(){
          this.$emit('cancel')
        }


    }
}
</script>
